package org.vshe.improve.pattern.effectivej.ch2;

public class NutritionFacts {
	private int a;
	private int b;
	private int c;
	private int d;
	private int e;
	private int f;
	private int g;
	
	private NutritionFacts(){
		throw new AssertionError();
	}
	
	private NutritionFacts(Builder builder) {
		a = builder.a;
		b = builder.b;
		c = builder.c;
		d = builder.d;
		e = builder.e;
		f = builder.f;
	}

	public static class Builder {
		private int a;
		private int b;
		private int c;
		private int d;
		private int e;
		private int f;
		private int g;

		public Builder() {

		}

		public Builder buildABC(int a, int b, int c) {
			this.a = a;
			this.b = b;
			this.c = c;
			return this;
		}

		public Builder buildDEF(int d, int e, int f) {
			this.d = d;
			this.f = f;
			this.e = e;
			return this;
		}

		public NutritionFacts build() {
			return new NutritionFacts(this);
		}
	}

	public static void main(String args) {
		NutritionFacts nutritionFacts = new NutritionFacts.Builder()
				.buildABC(1, 2, 3)
				.buildDEF(4, 5, 6)
				.build();

	}
}
